#测试类
import pytest

from Auto.day02.login.Login_Operation import Login_Operation
from Auto.day02.login.Login_Data import Login_Data
import yaml
from utils.ReadYaml import ReadYaml
from utils.XLUtils import XLUtils


class Test_Login(Login_Operation):

    #读取数据类里面的数据
    @pytest.mark.parametrize("username,password,expect",Login_Data.login_data)
    def test_login1(self, login_driver, login_page, username, password, expect):
        result = self.getSuccessResult(login_driver)
        self.assserttitle(login_driver, result, expect)
    #读取yaml文件数据
    @pytest.mark.parametrize("username,password,expect",ReadYaml.read_yaml("D:\Python\Project\project01\Auto\day02\data.yaml")['login'])
    def test_login2(self,login_driver,login_page,username,password,expect):
        result = self.getSuccessResult(login_driver)
        self.assserttitle(login_driver,result,expect)
    #读取excel文件数据
    @pytest.mark.parametrize("username,password,expect",
                             XLUtils.read_excel("D:\Python\Project\project01\Auto\day02\data.xlsx", "login"))
    def test_login3(self, login_driver, login_page, username, password, expect):
        result = self.getSuccessResult(login_driver)
        self.assserttitle(login_driver, result, expect)






